// (C) 2022 Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions and other 
// software and tools, and its AMPP partner logic functions, and any output 
// files from any of the foregoing (including device programming or simulation 
// files), and any associated documentation or information are expressly subject 
// to the terms and conditions of the Intel Program License Subscription 
// Agreement, Intel FPGA IP License Agreement, or other applicable 
// license agreement, including, without limitation, that your use is for the 
// sole purpose of programming logic devices manufactured by Intel and sold by 
// Intel or its authorized distributors.  Please refer to the applicable 
// agreement for further details.

interface i3c_phy_cfg_if (
    input clk,
    input rstn
);

    import i3c_pkg::*;

    operation_mode_t operation_mode;
    device_t         device;
    logic     [ 2:0] mode;       
    logic     [ 2:0] error;

    modport master (
        output operation_mode,
        output device,
        output mode,
        input  error    
    );

    modport slave (
        input  operation_mode,
        input  device,
        input  mode,
        output error    
    );

    modport monitor (
        input operation_mode,
        input device,
        input mode,
        input error
    );

    `ifdef SIMULATION
        clocking cb_master @ (posedge clk);
            input operation_mode;
            input device;
            input mode;
            input error;
        endclocking

        modport cb_master_modport (
            input rstn,
            clocking cb_master
        );

        clocking cb_slave @ (posedge clk);
            inout operation_mode;
            inout device;
            inout mode;
            input error;
        endclocking

        modport cb_slave_modport (
            input rstn,
            clocking cb_slave
        );

        clocking cb_monitor @ (posedge clk);
            input operation_mode;
            input device;
            input mode;
            input error;
        endclocking

        modport cb_monitor_modport (
            input rstn,
            clocking cb_monitor
        );
    `endif 
endinterface